<?php


namespace app\command;


use app\common\lib\ZhyxBeanstalkd;
use app\impl\EmployeeGranule;
use app\impl\SimpleFactory;
use Linqiao\Addtran\PhoneRegion;
use think\console\Command;
use think\console\Input;
use think\console\Output;


class SyncFollowData extends Command
{
    protected function configure(): void
    {
        // 指令配置
        $this->setName('watchClearData')
            ->setDescription('消费者队列');
    }

    protected function execute(Input $input, Output $output)
    {
        $data = [
            "startDate" => date("Y-m-d", strtotime("-3 day")),
            'tubeName' => 'EmployeeGranule'
        ];
        $result = ZhyxBeanstalkd::getInstance()->beansTalk->useTube("employeeGranule")->put(json_encode($data, JSON_THROW_ON_ERROR), 0, 0);
        if ($result !== false) {
            $output->writeln($data["startDate"] . "随访数据同步任务投递成功");
        }
    }
}